package com.thon.dao.topic.impl;

import com.thon.commons.persistence.BaseDaoImpl;
import com.thon.dao.topic.ChoiceDao;
import com.thon.entity.topic.Choice;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Chen on 2016/2/17.
 */
@Repository
public class ChoiceDaoImpl extends BaseDaoImpl<Choice> implements ChoiceDao {

    public ChoiceDaoImpl() {
        super(Choice.class);
    }

    @Override
    public List<Choice> ifChoice(Integer id) {
        String queryString = "FROM Choice c WHERE c.student.id = ? and c.delFlag = ?";
        return findList(queryString, id, Choice.DEL_FLAG_NORMAL);
    }
}
